Telegram Group & Telegram Channel
Обработка ошибок с помощью reportError

Стэфан Джудис рассказал про малоизвестный метод для облегчения обработки ошибок в библиотечном коде — "New in JavaScript: reportError – a method to report to global event handlers".

Для логирования ошибок на странице часто устанавливают глобальный обработчик события error. Библиотеки могут редиректить возникающие исключения в этот глобальный обработчик с помощью setTimeout, но такой код выглядит как хак. Для упрощения решения этой проблемы в платформу был добавлен специальный метод reportError:

try {
fn();
} catch (error) {
// добавление кастомной обработки исключений и
// вызов глобального обработчика
reportError(error);
}

Поддержка метода reportError есть во всех актуальных браузерах.

#js

https://www.stefanjudis.com/blog/reporterror-a-method-to-report-to-global-event-handlers/



tg-me.com/defront/1136
Create:
Last Update:

Обработка ошибок с помощью reportError

Стэфан Джудис рассказал про малоизвестный метод для облегчения обработки ошибок в библиотечном коде — "New in JavaScript: reportError – a method to report to global event handlers".

Для логирования ошибок на странице часто устанавливают глобальный обработчик события error. Библиотеки могут редиректить возникающие исключения в этот глобальный обработчик с помощью setTimeout, но такой код выглядит как хак. Для упрощения решения этой проблемы в платформу был добавлен специальный метод reportError:


try {
fn();
} catch (error) {
// добавление кастомной обработки исключений и
// вызов глобального обработчика
reportError(error);
}

Поддержка метода reportError есть во всех актуальных браузерах.

#js

https://www.stefanjudis.com/blog/reporterror-a-method-to-report-to-global-event-handlers/

BY Defront — про фронтенд-разработку и не только




Share with your friend now:
tg-me.com/defront/1136

View MORE
Open in Telegram


Defront при поддержке Зарплата ру — про фронтенд разработку и не только Telegram | DID YOU KNOW?

Date: |

Newly uncovered hack campaign in Telegram

The campaign, which security firm Check Point has named Rampant Kitten, comprises two main components, one for Windows and the other for Android. Rampant Kitten’s objective is to steal Telegram messages, passwords, and two-factor authentication codes sent by SMS and then also take screenshots and record sounds within earshot of an infected phone, the researchers said in a post published on Friday.

Telegram today rolling out an update which brings with it several new features.The update also adds interactive emoji. When you send one of the select animated emoji in chat, you can now tap on it to initiate a full screen animation. The update also adds interactive emoji. When you send one of the select animated emoji in chat, you can now tap on it to initiate a full screen animation. This is then visible to you or anyone else who's also present in chat at the moment. The animations are also accompanied by vibrations. This is then visible to you or anyone else who's also present in chat at the moment. The animations are also accompanied by vibrations.

Defront при поддержке Зарплата ру — про фронтенд разработку и не только from ms


Telegram Defront — про фронтенд-разработку и не только
FROM USA